Passed
Push — master ( 33dd36...c64a01 )
by René
03:33
created

app.js ➔ deletePoll   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 2
nc 2
nop 1
1
function deletePoll($pollEl) {
2
	var str = t('polls', 'Do you really want to delete that poll (new)?') + '\n\n' + $($pollEl).attr('data-value');
3
	if (confirm(str)) {
4
		var form = document.form_delete_poll;
5
		var hiddenId = document.createElement("input");
6
		hiddenId.setAttribute("name", "pollId");
7
		hiddenId.setAttribute("type", "hidden");
8
		form.appendChild(hiddenId);
9
		form.elements.pollId.value = $pollEl.id.split('_')[2];
10
		form.submit();
11
	}
12
}
13